package com.ybfenpan.controller.member;


import com.ybfenpan.controller.core.BaseController;
import com.ybfenpan.model.Member;
import com.ybfenpan.utils.ContextUtil;
import com.ybfenpan.utils.CryptUtil;
import com.ybfenpan.utils.MapUtil;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;


@Controller
public class PwdTwoValidationController extends BaseController {

 

	@RequestMapping("member/pwdTwoValidation.shtml")
	public String pwdTwoValidation(HttpServletRequest request, HttpServletResponse response, Model model) throws Exception {
		Map formMap = getParameterMap(request);
		Member member = ContextUtil.getMember();
		String result=""; 
		String path = MapUtil.getString(formMap, "path");
		
		request.setAttribute("path", path); 
		 
		String myTwoPassword = MapUtil.getString(formMap, "myTwoPassword");
		
		String myTwoPasswordKey = "";
		 
		if(myTwoPassword!=""&&myTwoPassword!=null){
			myTwoPasswordKey = CryptUtil.getInstance().encrypt2String(myTwoPassword,CryptUtil.keyStr);
		}
		
		if(!myTwoPasswordKey.equals(member.getTwoPassword())){
			setMessage(model,"请输入正确的安全密码。");
			return "member/pwdTwoValidation";
		}else{
			
			
			/***********************代理商管理*********************************/
			if(path.equals("99")){				//未开通代理商
				
				result="redirect:member/memberAddShow.shtml";
				 
			}
			if(path.equals("100")){				//未开通代理商
				result="redirect:member/memberNoActiveList.shtml";
				
			}
			if(path.equals("101")){				//已开通代理商
				result="redirect:member/memberYesActiveList.shtml";
				  
			}
			if(path.equals("102")){				//我的直接推荐
				result="redirect:member/tuRecommend.shtml";
				
			}
			if(path.equals("103")){				//我的团队
				result="redirect:member/tuKuang.shtml";
				
			}

			if(path.equals("104")){				//原点升级
				result="redirect:member/accountShengShow.shtml";
				
			}
			if(path.equals("105")){			//申请管理中心
				result="redirect:member/requestCenterAddShow.shtml";
				
			}
			if(path.equals("106")){			//申请管理中心列表
				result="redirect:member/requestCenterList.shtml";
				
			}
			
			if(path.equals("107")){			//公排图
				result="redirect:member/tuGong.shtml";
				
			}
			if(path.equals("108")){			//报单码列表
				result="redirect:member/jihuoCodeList.shtml";
				
			}
			
			if(path.equals("109")){			// 
				result="redirect:member/jihuoCodeSellShow.shtml";
				
			}
			 
			/***********************提现管理*********************************/
			if(path.equals("200")){				//资产值提现
				result="redirect:ti/moneyTiShow.shtml";
				
			}
			 
			if(path.equals("201")){				//提现列表
				result="redirect:ti/moneyTiList.shtml";
				
			}

			if(path.equals("202")){				//资产值提现
				result="redirect:ti/shuiTiShow.shtml";
				
			}
			if(path.equals("203")){				//提现列表
				result="redirect:ti/shuiTiList.shtml";
				
			}
			
			
			/***********************财务管理*********************************/
			 
			if(path.equals("300")){				//每日奖金统计
				result="redirect:wealth/wageList.shtml";
				
			}
			if(path.equals("301")){			//资产值转账
				result="redirect:wealth/moneyPayShow.shtml";
				
			} 
			if(path.equals("302")){			//资产值明细
				result="redirect:wealth/logMoneyList.shtml";
				
			}

			if(path.equals("303")){			//资产值转HS积分
				result="redirect:wealth/moneyZhuanEleShow.shtml";
				
			}
			if(path.equals("304")){			//HS积分转账
				result="redirect:wealth/elePayShow.shtml";
				
			}
			if(path.equals("305")){			//HS积分明细
				result="redirect:wealth/logEleList.shtml";
				
			}
			if(path.equals("306")){			//电子股明细
				result="redirect:wealth/logStoreList.shtml";
				
			}
			if(path.equals("307")){			//创业金明细
				result="redirect:wealth/logChuangyeList.shtml";
				
			}
			if(path.equals("308")){			//总监钱包
				result="redirect:wealth/logShuiList.shtml";
				
			}
			if(path.equals("309")){			//总监钱包转HS积分
				result="redirect:wealth/shuiZhuanEleShow.shtml";
				
			}
			if(path.equals("310")){			//总监钱包转幸运积分
				result="redirect:wealth/shuiZhuanChuangyeShow.shtml";
				
			}
			if(path.equals("311")){			//资产值转幸运积分
				result="redirect:wealth/moneyZhuanChuangyeShow.shtml";
				
			}
			if(path.equals("312")){			//资产值转账
				result="redirect:wealth/shuiPayShow.shtml";
				
			}
			
			/***********************汇款管理*********************************/
		 
			if(path.equals("400")){			//汇款登记
				result="redirect:member/huiAddShow.shtml";
				
			}
			if(path.equals("401")){			//汇款列表
				result="redirect:member/huiList.shtml";
				
			}
			
			
			
			/***********************个人资料*********************************/
			
			
			if(path.equals("500")){			//个人信息
				result="redirect:info/updateSelfShow.shtml";
				
			}
			if(path.equals("501")){			//银行信息
				result="redirect:info/updateBankShow.shtml";
				
			}
			 
			if(path.equals("502")){			//我的收件箱
				result="redirect:info/messageList.shtml";
				
			}
			
			if(path.equals("503")){			//发邮件
				result="redirect:info/messageSend.jsp";
				
			}
			
			if(path.equals("504")){			//我的发件箱
				result="redirect:info/messageSendList.shtml";
				
			}
			
			if(path.equals("505")){			//系统公告
				result="redirect:info/noticeList.shtml";
				
			}
			 
			if(path.equals("506")){			//提交留言
				result="redirect:info/servicesAdd.jsp";
				
			}
			
			if(path.equals("507")){			//留言列表
				result="redirect:info/servicesList.shtml";
				
			}

			
			
			
			
		}
		 
		return result;
	}
	
	 
	
}
